package com.moon.back.exception;

import cn.dev33.satoken.exception.NotLoginException;
import cn.hutool.core.util.ObjectUtil;
import com.moon.back.exception.inter.IError;

import static com.moon.back.exception.UserBusinessErrorEnum.CONNECTION_SYMBOL;
import static com.moon.back.exception.UserBusinessErrorEnum.ERROR_CODE_PREFIX;

/**
 *
 */
public class HdfsNotLoginException extends NotLoginException implements IError {

    String message;

    String code;

    String statusCode;

    public HdfsNotLoginException(String message, String loginType, String type) {

        super(message, loginType, type);
        this.message = message;

    }

    @Override
    public String getErrorCode() {
        return  ERROR_CODE_PREFIX.concat(CONNECTION_SYMBOL).concat(this.code);
    }

    @Override
    public String getStatusCode() {
        return ObjectUtil.defaultIfNull(this.statusCode, StatusCodeEnum.BAD_REQUEST.getCode());
    }
}
